package com.stlm2.dems.user.entity;

/**
 * Created by ZLQ on 2017/7/11.
 */
public enum PermissionType {
//    1：URL 2：子菜单 3:按钮 4：父菜单
    URL(1) {
        public String toString() {
            return "URL";
        }
    },
    Menu(2) {
        public String toString() {
            return "子菜单";
        }
    },
    Button(3) {
        public String toString() {
            return "按钮";
        }
    },
    SuperMenu(4) {
        public String toString() {
            return "父菜单";
        }
    };

    private final int val;

    PermissionType(int n) {
        val = n;
    }

    public int getIntValue() {
        return val;
    }

    public static PermissionType getByIntValue(int n) {
        switch (n) {
            case 1:
                return URL;
            case 2:
                return Menu;
            case 3:
                return Button;
            case 4:
                return SuperMenu;
            default:
                return null;
        }
    }
}
